package com.douyu.test;

import java.util.List;

import com.geccocrawler.gecco.GeccoEngine;
import com.geccocrawler.gecco.annotation.Gecco;
import com.geccocrawler.gecco.annotation.HtmlField;
import com.geccocrawler.gecco.spider.HtmlBean;

/**
 * @Description :
 * @FileName: DouyuPage.java
 * @Author :WeiHui.Zhang
 * @Data : 2016年3月25日 下午7:30:12
 * @Version:V1.00
 */
@Gecco(matchUrl = "http://www.douyu.com/directory/all", pipelines = { "consolePipeline" })
public class DouyuPage implements HtmlBean {

	private static final long serialVersionUID = 1L;

	@HtmlField(cssPath = "#live-list-contentbox li")
	private List<Room> rooms;

	public List<Room> getRooms() {
		return rooms;
	}

	public void setRooms(List<Room> rooms) {
		this.rooms = rooms;
	}

	public static void main(String[] args) {
		GeccoEngine.create().classpath("com.douyu.test").start("http://www.douyu.com/directory/all")
				// 开启几个爬虫线程
				.thread(1)
				// 单个爬虫每次抓取完一个请求后的间隔时间
				.interval(2000).run();
	}

}
